package com.example.demo.controller;

import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authz.annotation.RequiresRoles;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.example.demo.common.BaseResult;

@RestController
@RequestMapping("/admin")
public class AdminController {
	
    @RequestMapping(value = "/getMessage", method = RequestMethod.GET)
    @RequiresRoles("admin")
    public BaseResult getMessage() {
        return new BaseResult(200, "管理员", SecurityUtils.getSubject().getSession().getAttribute("currentUserId"));
    }
}
